package com.kosam.rabbitmqservice.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Created by tgx on 2017/3/7.
 */
@Component
@RabbitListener(queues = "hello")
public class Receiver {
    @RabbitHandler
    public void process(String hello) throws InterruptedException {
        Thread.sleep(30 * 1000);
        System.out.println("Receiver : " + hello +" "+ new Date());
    }
}
